import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import entity.Student;
import mybatis.QueryAdapter;
import mybatis.QueryCondition;

import javax.security.auth.Subject;
import java.util.HashMap;
import java.util.Map;


/**
 * @author CKC
 * @date 2022/11/10 13:56
 */
public class Main {
    public static void main(String[] args) {
        QueryCondition queryCondition = new QueryCondition();
        Map<String, String> search = new HashMap<>(8);
        search.put("name", "123");
        search.put("email", "42344");
        queryCondition.setSearch(search);

        queryCondition.setLte(search);




        QueryAdapter<Student> studentQueryAdapter = new QueryAdapter<Student>(true, queryCondition, Student.class) {
            @Override
            protected String convertConditionField(String field) {
                return super.convertConditionField(field);
            }
        };
        QueryWrapper<Student> wrapper = studentQueryAdapter.buildQueryWrapper();
        System.out.println(wrapper.getSqlSegment());
        System.out.println(wrapper.getTargetSql());
        System.out.println(wrapper.getCustomSqlSegment());
        System.out.println(wrapper.getParamAlias());
        System.out.println(wrapper.getExpression().getSqlSegment());
        LambdaQueryWrapper<Student> lambda = new QueryWrapper<Student>().lambda();
        lambda.eq(Student::getAge, 12);


    }
}
